package com.cskaoyan.market.controller.wx;

import com.cskaoyan.market.service.wx.WxCategoryService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCategoryService marketCategoryService;

    // 全部分类

    @GetMapping("/index")
    public Object index(){
        Map<String,Object> result = marketCategoryService.index();

        Object o = ResponseUtil.ok(result);
        return o;
    }

    // 当前分类

    @GetMapping("/current")
    public Object current(Integer id){

         Map<String,Object> result = marketCategoryService.current(id);

        Object o = ResponseUtil.ok(result);
        return o;
    }
}
